package com.pwc.conversionTool.config;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletContext;

import org.dom4j.DocumentException;

/**

 * extends this class for process xml config

 */

public abstract class XMLConfig {

	protected ConfigBase configBase;

	public XMLConfig(String path) throws DocumentException {
		configBase = new ConfigBase(path);
	}
	
	public XMLConfig(){
		
	}
	
	public Map<String, String> getXMLMap(String xPath){
		return configBase.getXMLMap(xPath);
	}
	
	public void saveDocument() throws IOException {
		configBase.saveDocument();
	}

	public void saveDocument(String xml) throws DocumentException, IOException {
		configBase.saveDocument(xml);
	}

	public String getXMLString() throws IOException {
		return configBase.toString();
	}
	
	public void addNodeByXpath(String xPath, String nodeName, String value) 
	{
		configBase.addNodeByXpath(xPath, nodeName, value);
	}
	
	public void deleteNodeByXpath(String xPath)
	{
		configBase.deleteNodeByXpath(xPath);
	}
	
}
